package com.wanmait.schedule.service.impl;

import com.wanmait.schedule.entity.Data;
import com.wanmait.schedule.entity.Journal;
import com.wanmait.schedule.mapper.JournalMapper;
import com.wanmait.schedule.service.DataService;
import com.wanmait.schedule.service.JournalService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 * 工作日志表 服务实现类
 * </p>
 *
 * @author wanmait
 * @since 2022-03-02
 */
@Service
public class JournalServiceImpl extends ServiceImpl<JournalMapper, Journal> implements JournalService {
    @Resource
    private JournalMapper journalMapper;
    @Resource
    private DataService dataService;
    @Override
    public void insert(Journal journal,Data data) {
        journalMapper.insert(journal);
        Integer id = journal.getId();
        data.setJournalId(id);
        dataService.save(data);
    }
}
